/******************************************************************************
 * * phone_msg_handle.h -
 *
 * *(C) Copyright 2019 ASR International Ltd.
 * * All Rights Reserved
 * ******************************************************************************/
#ifndef PHONE_MSG_HANDLE_H
#define PHONE_MSG_HANDLE_H

#ifdef __cplusplus
extern "C" {
#endif

#include "lv_conf.h"
#if USE_LV_WATCH_MODEM_ADAPTOR
#include "lvgl.h"
#include "ui_global.h"
#include "ui_inter_msg_interface.h"
#include "inter_modemadp_interface.h"
#include "../../modem/mmi_modem_adaptor_main.h"
#include "hal/hal_bt.h"
#include "inter_bt_interface.h"
#include "../../apps/settings/setting_wlan.h"
// UI_INTER_MSG_ID of watch UI
enum
{
    MMI_MODEM_POWER_UP_CNF = 0,
    MMI_MODEM_POWER_OFF_CNF,
    MMI_MODEM_CALL_RESPONSE_ORIGINATING,
    MMI_MODEM_CALL_RESPONSE_GET_CUR_CALLS,
    MMI_MODEM_CALL_RESPONSE_ALERTING,
    MMI_MODEM_CALL_RESPONSE_RING,
    MMI_MODEM_CALL_RESPONSE_CONNECT,
    MMI_MODEM_CALL_RESPONSE_DISCONNECT,
    MMI_MODEM_CALL_RESPONSE_NO_CARRIER,
    MMI_MODEM_CALL_RESPONSE_DIAL,
    MMI_MODEM_CALL_RESPONSE_CLIP,
    MMI_MODEM_CALL_RESPONSE_CCWA,
    MMI_MODEM_CALL_RESPONSE_STATE_CHANGE,
    MMI_MODEM_CALL_RESPONSE_REMOTE_HOLD,
    MMI_MODEM_CALL_RESPONSE_CMUT,
    MMI_MODEM_PIN_STATUS_CHANGE_IND,
    MMI_MODEM_PLMN_SEARCH_CNF,
    MMI_MODEM_CALL_FORWARD_SET_CNF,
    MMI_MODEM_CALL_FORWARD_QUERY_CNF,
    MMI_MODEM_CALL_WAIT_SET_CNF,
    MMI_MODEM_CALL_WAIT_QUERY_CNF,
    MMI_MODEM_SIGNAL_BAR_IND,
    MMI_MODEM_OPERATOR_IND,
    MMI_MODEM_TIME_UPDATE_IND,
    MMI_MODEM_SIM_STATUS_IND,
    MMI_MODEM_GET_PHONEBOOK_STATUS_CNF,
    MMI_MODEM_WRITE_PHONEBOOK_CNF,
    MMI_MODEM_READ_PHONEBOOK_CNF,
    MMI_MODEM_PHONEBOOK_INIT_IND,
    MMI_MODEM_SEND_SMS_CNF,
    MMI_MODEM_DELETE_SMS_CNF,
    MMI_MODEM_READ_SMS_INFO_CNF,
    MMI_MODEM_READ_SMS_DETAIL_ON_SIM_CNF,
    MMI_MODEM_GET_SMSC_CNF,
    MMI_MODEM_SET_SMSC_CNF,
    MMI_MODEM_SET_DELIVERY_REP_CNF,
    MMI_MODEM_REP_NEW_SMS_IND,
    MMI_MODEM_SMS_STATUS_REP_IND,
    MMI_MODEM_SIM_SMS_STORAGE_STATUS_IND,
    MMI_MODEM_SEND_USSD_CNF,
    MMI_MODEM_LTE_CELLS_INFO,
    MMI_MODEM_GSM_CELLS_INFO,
    MMI_HAL_LOW_POWER_IND,
    MMI_APP_ADAPTOR_VOICE_MSG_RCV_IND,
    MMI_APP_ADAPTOR_VOICE_MSG_SEND_CNF,
#if USE_LV_WLAN != 0
    MMI_WLAN_REFRESH_IND,
    MMI_WLAN_PERIODIC_SCAN_START_IND,
#endif
};

typedef struct
{
    UI_Inter_Msg_Header_t header;
    MMI_MODEM_SIM_ID      simid;
} mmi_msg_power_up_cnf_t;

typedef struct
{
    UI_Inter_Msg_Header_t header;
    MMI_MODEM_SIM_ID      simid;
} mmi_msg_power_off_cnf_t;

typedef struct
{
    UI_Inter_Msg_Header_t header;
    MMI_MODEM_SIM_ID      simid;
    int8_t                index;
} mmi_msg_call_response_originating_t;

typedef struct
{
    UI_Inter_Msg_Header_t header;
    MMI_Modem_Call_Rsp_Get_Current_Calls_t *calls;
} mmi_msg_call_response_get_cur_calls_t;

typedef struct
{
    UI_Inter_Msg_Header_t header;
    MMI_MODEM_SIM_ID      simid;
    int8_t                index;
} mmi_msg_call_response_alerting_t;

typedef struct
{
    UI_Inter_Msg_Header_t header;
    MMI_MODEM_SIM_ID      simid;
    int8_t                index;
} mmi_msg_call_response_ring_t;

typedef struct
{
    UI_Inter_Msg_Header_t header;
    MMI_MODEM_SIM_ID      simid;
    int8_t                index;
} mmi_msg_call_response_connect_t;

typedef struct
{
    UI_Inter_Msg_Header_t header;
    MMI_MODEM_SIM_ID      simid;
    int8_t                index;
} mmi_msg_call_response_disconnect_t;

typedef struct
{
    UI_Inter_Msg_Header_t header;
    MMI_MODEM_SIM_ID      simid;
    int8_t                index;
    uint8_t               isNoCarrier;
} mmi_msg_call_response_no_carrier_t;

typedef struct
{
    UI_Inter_Msg_Header_t header;
    MMI_MODEM_SIM_ID      simid;
    uint8_t               isOk;
} mmi_msg_call_response_dial_t;

typedef struct
{
    UI_Inter_Msg_Header_t          header;
    MMI_MODEM_SIM_ID               simid;
    int8_t                         index;
    MMI_Modem_Call_Response_Clip_t *clip;
} mmi_msg_call_response_clip_t;

typedef struct
{
    UI_Inter_Msg_Header_t          header;
    MMI_MODEM_SIM_ID               simid;
    int8_t                         index;
    MMI_Modem_Call_Response_Ccwa_t *ccwa;
} mmi_msg_call_response_ccwa_t;

typedef struct
{
    UI_Inter_Msg_Header_t                  header;
    MMI_Modem_Call_Response_State_Change_t *state;
} mmi_msg_call_response_state_change_t;

typedef struct
{
    UI_Inter_Msg_Header_t header;
    MMI_MODEM_SIM_ID      simid;
    int8_t                index;
    uint8_t               ishold;
} mmi_msg_call_response_remote_hold_t;

typedef struct
{
    UI_Inter_Msg_Header_t          header;
    MMI_MODEM_SIM_ID               simid;
    MMI_Modem_Call_Response_Cmut_t *cmut;
} mmi_msg_call_response_cmut_t;

typedef struct
{
    UI_Inter_Msg_Header_t     header;
    MMI_MODEM_SIM_ID          simid;
    MMI_MODEM_PIN_STATUS_TYPE pinreqtype;
} mmi_msg_pin_status_change_ind_t;

typedef struct
{
    UI_Inter_Msg_Header_t       header;
    MMI_Modem_Plmn_Search_Cnf_t *plmnsearchcnf;
} mmi_msg_plmn_search_cnf_t;

typedef struct
{
    UI_Inter_Msg_Header_t header;
    MMI_MODEM_SIM_ID      simid;
    MMI_MODEM_RESULT      result;
} mmi_msg_call_forward_set_cnf_t;

typedef struct
{
    UI_Inter_Msg_Header_t         header;
    MMI_MODEM_SIM_ID              simid;
    MMI_MODEM_RESULT              result;
    MMI_Modem_Call_Forward_Info_t *CallForwardInfo;
} mmi_msg_call_forward_query_cnf_t;

typedef struct
{
    UI_Inter_Msg_Header_t header;
    MMI_MODEM_SIM_ID      simid;
    MMI_MODEM_RESULT      result;
} mmi_msg_call_wait_set_cnf_t;

typedef struct
{
    UI_Inter_Msg_Header_t header;
    MMI_MODEM_SIM_ID      simid;
    uint8_t               callwaiton;
    MMI_MODEM_RESULT      result;
} mmi_msg_call_wait_query_cnf_t;

typedef struct
{
    UI_Inter_Msg_Header_t header;
    MMI_MODEM_SIM_ID      simid;
    MMI_MODEM_SIGNAL_BAR  bar;
} mmi_msg_signal_bar_ind_t;

typedef struct
{
    UI_Inter_Msg_Header_t header;
    MMI_MODEM_SIM_ID      simid;
    char *operator;
    MMI_MODEM_PLMN_RAT rat;
} mmi_msg_operator_ind_t;

typedef struct
{
    UI_Inter_Msg_Header_t header;
    MMI_Modem_Time_Info_t *TimeInfo;
} mmi_msg_time_update_ind_t;

typedef struct
{
    UI_Inter_Msg_Header_t  header;
    MMI_Modem_Sim_Status_t *SimStatus;
} mmi_msg_sim_status_ind_t;

typedef struct
{
    UI_Inter_Msg_Header_t      header;
    MMI_MODEM_SIM_ID           simid;
    MMI_Modem_Phonebook_Status *PhkStatus;
} mmi_msg_get_phonebook_status_cnf_t;

typedef struct
{
    UI_Inter_Msg_Header_t header;
    MMI_MODEM_SIM_ID      simid;
    uint16_t              writtenindex;
} mmi_msg_write_phonebook_cnf_t;

typedef struct
{
    UI_Inter_Msg_Header_t header;
    MMI_MODEM_SIM_ID      simid;
    MMI_Modem_Contact     *contact;
    uint16_t              number;
    BOOL                  end;
} mmi_msg_read_phonebook_cnf_t;

typedef struct
{
    UI_Inter_Msg_Header_t header;
    MMI_MODEM_SIM_ID      simid;
} mmi_msg_phonebook_init_ind_t;

typedef struct
{
    UI_Inter_Msg_Header_t    header;
    MMI_Modem_Send_Sms_Cnf_t *psendsmscnf;
} mmi_msg_send_sms_cnf_t;

typedef struct
{
    UI_Inter_Msg_Header_t      header;
    MMI_Modem_Delete_Sms_Req_t *pdeletesms;
} mmi_msg_delete_sms_cnf_t;

typedef struct
{
    UI_Inter_Msg_Header_t         header;
    MMI_Modem_Read_Sms_Info_Cnf_t *preadsmsinfocnf;
} mmi_msg_read_sms_info_cnf_t;

typedef struct
{
    UI_Inter_Msg_Header_t                  header;
    MMI_Modem_Read_Sms_Detail_On_Sim_Cnf_t *preadsmscnf;
} mmi_msg_read_sms_detail_on_sim_cnf_t;

typedef struct
{
    UI_Inter_Msg_Header_t    header;
    MMI_Modem_Get_Smsc_Cnf_t *pgetsmsccnf;
} mmi_msg_get_smsc_cnf_t;

typedef struct
{
    UI_Inter_Msg_Header_t     header;
    MMI_MODEM_SMS_RESULT_TYPE result;
} mmi_msg_set_smsc_cnf_t;

typedef struct
{
    UI_Inter_Msg_Header_t     header;
    MMI_MODEM_SMS_RESULT_TYPE result;
} mmi_msg_set_delivery_rep_cnf_t;

typedef struct
{
    UI_Inter_Msg_Header_t          header;
    MMI_Modem_Report_New_Sms_Ind_t *prepnewsms;
} mmi_msg_rep_new_sms_ind_t;

typedef struct
{
    UI_Inter_Msg_Header_t                   header;
    MMI_Modem_Response_Sms_Status_Rep_Ind_t *psmsstsrep;
} mmi_msg_sms_status_rep_ind_t;

typedef struct
{
    UI_Inter_Msg_Header_t                  header;
    MMI_Modem_SIM_SMS_Storage_Status_Ind_t *prepsimsmsstaind;
} mmi_msg_sim_sms_storage_status_ind_t;

typedef struct
{
    UI_Inter_Msg_Header_t     header;
    MMI_Modem_Send_Ussd_Cnf_t *psendussdcnf;
} mmi_msg_send_ussd_cnf_t;

typedef struct
{
    UI_Inter_Msg_Header_t     header;
    MMI_Modem_Lte_Cells_t     *pltecells;
} mmi_msg_lte_cells_info_t;

typedef struct
{
    UI_Inter_Msg_Header_t     header;
    MMI_Modem_Gsm_Cells_t     *pgsmcells;
} mmi_msg_gsm_cells_info_t;

typedef struct
{
    UI_Inter_Msg_Header_t header;
    uint32_t              bat_percent;
} mmi_msg_low_power_ind_t;

typedef struct
{
    UI_Inter_Msg_Header_t   header;
    app_adaptor_voice_msg_t *msg;
} mmi_msg_app_adaptor_voice_msg_rcv_ind_t;

typedef struct
{
    UI_Inter_Msg_Header_t            header;
    watch_app_adp_voice_msg_result_t result;
} mmi_msg_app_adaptor_voice_msg_send_cnf_t;

typedef struct
{
    UI_Inter_Msg_Header_t header;
    MMI_MODEM_SIM_ID      simid;
    uint8_t               active;
} mmi_msg_ps_response_data_call_t;

void phone_message_handle_init(void);
void phone_message_handle_destroy(void);
#ifdef __cplusplus
}
#endif
#endif
#endif/*#if USE_LV_WATCH_MODEM_ADAPTOR*/
